import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralFileTemplate = (params) => {
  params.head.transCode = 'queryGeneralFileTemplate';
  return request({
    url: '/general/generalFileTemplate/queryGeneralFileTemplate',
    method: 'post',
    data: params
  })
}
//多条列表查询
export const queryGeneralFileTemplateList = (params) => {
  params.head.transCode = 'queryGeneralFileTemplateList';
  return request({
    url: '/general/generalFileTemplate/queryGeneralFileTemplateList',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralFileTemplateListPage = (params) => {
  params.head.transCode = 'queryGeneralFileTemplateListPage';
  return request({
    url: '/general/generalFileTemplate/queryGeneralFileTemplateListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralFileTemplate = (params) => {
  params.head.transCode = 'saveGeneralFileTemplate';
  return request({
    url: '/general/generalFileTemplate/saveGeneralFileTemplate',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralFileTemplateList = (params) => {
  params.head.transCode = 'saveGeneralFileTemplateList';
  return request({
    url: '/general/generalFileTemplate/saveGeneralFileTemplateList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralFileTemplate = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralFileTemplate';
  return request({
    url: '/general/generalFileTemplate/saveOrUpdateGeneralFileTemplate',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralFileTemplateList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralFileTemplateList';
  return request({
    url: '/general/generalFileTemplate/saveOrUpdateGeneralFileTemplateList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralFileTemplate = (params) => {
  params.head.transCode = 'updateGeneralFileTemplate';
  return request({
    url: '/general/generalFileTemplate/updateGeneralFileTemplate',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralFileTemplate = (params) => {
  params.head.transCode = 'deleteGeneralFileTemplate';
  return request({
    url: '/general/generalFileTemplate/deleteGeneralFileTemplate',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralFileTemplateList = (params) => {
  params.head.transCode = 'deleteGeneralFileTemplateList';
  return request({
    url: '/general/generalFileTemplate/deleteGeneralFileTemplateList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralFileTemplateExcel = (params) => {
  downloadExcel({
    url: '/general/generalFileTemplate/excelDownload/exportGeneralFileTemplateExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
